/**
 * 
 */
package com.lifeware.research.endo.models.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

/**
 * <p>Tipo base per tutti i DAO H8.
 * </p>
 * 
 * @author  Riccardo Cardin, (C) 2012 Lifeware
 * @version 1.0
 */
public abstract class AbsHibernateDao {

	protected SessionFactory sessionFactory;
	
	public AbsHibernateDao(SessionFactory sessionFactory) {

		this.sessionFactory = sessionFactory;
	}
	
	/**
	 * <p>Ritorna la sessione H8 corrente.
	 * </p>
	 * 
	 * @return La sessione H8.
	 */
	protected Session getCurrentSession() {
		
		return this.sessionFactory.getCurrentSession();
	}
}
